29:47 / 1:19:52Xem toàn bộ video
Holy hell, thank you so much! I was feeling so helpless and discouraged because I needed to make something like this. Also, the "execute the children" was great!
6
Just finished watching this and I wish I had this available when I finished my AI for my game a few days ago hahah. Behaviour Trees are so powerful and I'd love to see this getting extended. Would be amazing to see you deal with a brain of some sort (like a Blackboard). Great tutorial :D
14
This is fantastic and I love having a visual way to setup my behaviour trees! I just want to add a few errors I ran into following this in case someone else experiences them as well: At 25:16 you say you change those two lines of code to just visualTree.CloneRoot(); and say it's not necessary but it absolutely is necessary for the window to work at all. I initially skipped this step but the window didn't show any of the features it did inside the editor preview. Also for the 44:52 bug where it throws a null reference error, even if I had the scriptable object selected in the project view I still got a null reference error and it never worked to add a node. I had to add the following code the BehaviourTreeView.cs in the CreateNode function after the if(tree) statement: else{ BehaviourTreeSO newtree = ScriptableObject.CreateInstance("BehaviourTreeSO") as BehaviourTreeSO; string path = $"Assets/DEBUGTREE.asset"; AssetDatabase.CreateAsset(newtree, path); // AssetDatabase.AddObjectToAsset(newtree, newtree); AssetDatabase.Refresh(); EditorUtility.SetDirty(newtree); AssetDatabase.SaveAssets(); tree = newtree; } This let me create a new Behaviour Tree scriptable object in the code and save it so that the window could reference it. Oddly even with this if I just select a different one in the project view it doesn't seem to work. Maybe something changed with the OnSelectionChanged method you used earlier or something? But so far this is the only way I've found to get it to actually work. Edit: Shortly after posting this I was looking around still trying to find a solution for the second part: Unity didn't seem to acknowledge when you picked the scriptable object in the project view. Well now all of a sudden it works just fine without me changing anything... This isn't the first time Unity has done this to me :/
3
Dude, this is for sure the best Behaviour Tree tutorial for Unity I've ever seen. Freaking awesome job you made! Thank you very much for sharing it! :)
2
This is absolutely amazing! I'm halfway through as I'm writing this and everything so far is clear and straight to the point. Good job!
I just started following some of your tutorials and your content is some of the best that I've seen for Unity thus far. Clear, concise and a high attention to detail. Looking forward to checking out the rest! Thanks!
18
This is awesome! Also, I had to change how the BehaviourTree (the asset) stores the connections between nodes - I use a single array of all the nodes in the tree and save their indexes. I also save the parent/child indexes in the nodes themselves. This is a bit painful (it requires updating all the indexes with each node deletion/addition), but it makes it possible to copy the tree (by using CTRL+D in Project View). Before the connections between nodes (children) were removed after duplicating the tree. I think it would be way easier to find the nodes by GUIDs (always) and save the GUIDs of children nodes but saving indexes instead gives me rather quick access to the nodes in runtime. Or am I just stupid and there is a simple way to make it all work with object references when duplicating the asset in the Project View? :)
2
This is über awesome. Not only ended it my quest for a visual Behaviour Tree (did BTs by script, but it got out of hand/too complex) -- it also teached me how to use UI Bilder! Thanks a million!
2
Dude... this was a sick breakdown of data structures and Unity features. Amazing and inspirational. This definitely gets the wheels turning!
2
This is a very helpful tutorial and I really appreciate it. This editor's going to save me a ton of time.
Nice tutorial, hard to keep across all the new stuff being added to Unity. You should look into the new pattern matching features of C# - usable in Unity 2019+ and lets you combing casting and the if check into one line for example: if (parent is CompositeNode cn) { cn.children.Add(child); } else if (parent is Decorator Node dn) {...} Etc. Also much more expressive pattern matching with switches in C# 8 which is Unity 2021.1+.
2
I appreciate a ton your tutorials, especially the ones on the behaviour tree. They're very useful so thanks for sharing, and keep it up! :)
6
It's just great, thank you very much for your work!
I want to go back to Unity because of your channel. This is pure gold.
I was trying to write this myself before discovering this video, and essentially made something like what you did.... But it wasn't as well made for sure. it worked, was perfectly usable, but was ultimately quite clunky. Looking at this.... it's better in just about every way. Props for making nodes so easy to write, too. I haven't seen many other behavior trees this simple and effective.
1
Amazing tutorial! thanks for making this, Im looking for this kind of video for a while.
2
thank you so much for this, great effort. Also notice the tree view is still experimental a year later :P
Thank you for this amazing tutorial. Really great, helped me a lot
This is gold, I wish many more people would appreciate such tutorials, hopefully your channel will grow. This graph topic, UI Builder and UIToolkit information sources are really scarce, not even many Unity devs are aware that such tools exist. Not sure if you are going to follow up with these series, but any UIToolkit/GraphView/UI Builder tutorial will be appreciated at least by me and my friends :) Thanks!
1
great video - thanks a lot. Not enough resources to the editor creation workflow and yours is very nice!